﻿@model CoffeeShop.Models.Entities.User

@{
    ViewBag.Title = "Đăng nhập";
    var resultNotFoundUser = (bool)ViewBag.NotFoundUser;
}
<html>
<head>
    <link href="~/assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="~/assets/css/bootstrap-responsive.min.css" rel="stylesheet">
    <link href="~/assets/css/font-awesome.min.css" rel="stylesheet">

    <link href="~/assets/css/jquery.gritter.css" rel="stylesheet" />
    <link rel="stylesheet" href="~/assets/css/ace.min.css">
    <link rel="stylesheet" href="~/assets/css/ace-responsive.min.css">
    <link rel="stylesheet" href="~/assets/css/ace-skins.min.css">

    <script src="~/assets/js/jquery-2.0.3.min.js"></script>
    <script src="~/assets/js/bootstrap.min.js"></script>
    <script src="~/assets/js/jquery-ui-1.10.3.custom.min.js"></script>
    <script src="~/assets/js/bootbox.min.js"></script>
    <script src="~/assets/js/jquery.gritter.min.js"></script>
    <script src="~/assets/js/spin.min.js"></script>

    <script src="~/assets/js/ace-elements.min.js"></script>
    <script src="~/assets/js/ace.min.js"></script>
    <script src="~/assets/js/jquery.validate.min.js"></script>

    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
</head>

<body class="login-layout">
    <div class="main-container container-fluid">
        <div class="main-content">
            <div class="row-fluid">
                <div class="span12">
                    <div class="login-container">
                        <div class="row-fluid">
                            <div class="center">
                                <h1>
                                    <i class="icon-leaf green"></i>
                                    <span class="red">Ace</span>
                                    <span class="white">Application</span>
                                </h1>
                                <h4 class="blue">&copy; Company Name</h4>
                            </div>
                        </div>

                        <div class="space-6"></div>

                        <div class="row-fluid">
                            <div class="position-relative">
                                <form action="/User/Login" method="post" name="LoginForm" id="loginForm">
                                    @Html.AntiForgeryToken();
                                    <!--/Login Form-->
                                    <div id="login-box" class="login-box visible widget-box no-border">
                                        <div class="widget-body">
                                            <div class="widget-main">
                                                <h4 class="header blue lighter bigger">
                                                    <i class="icon-coffee green"></i>
                                                    Xin hãy nhập thông tin
                                                </h4>

                                                <div class="space-6"></div>
                                                <fieldset>
                                                    <div class="control-group">
                                                        <div class="controls">
                                                            <label>
                                                                <span class="block input-icon input-icon-right">
                                                                    <input id="username" name="username" type="text" class="span12" placeholder="Username" />
                                                                    <i class="icon-user"></i>
                                                                </span>
                                                            </label>
                                                        </div>
                                                    </div>

                                                    <div class="control-group">
                                                        <div class="controls">
                                                            <label>
                                                                <span class="block input-icon input-icon-right">
                                                                    <input id="password" name="password" type="password" class="span12" placeholder="Password" />
                                                                    <i class="icon-lock"></i>
                                                                </span>
                                                            </label>
                                                        </div>
                                                    </div>

                                                    <div class="space"></div>

                                                    <div class="clearfix">
                                                        <button id="btnLogin" type="submit" class="btn btn-sm btn-primary" style="width: 100%">
                                                            <i class="icon-key"></i>
                                                            Đăng nhập
                                                        </button>
                                                    </div>

                                                    <div class="space-4"></div>
                                                </fieldset>

                                                <div class="social-or-login center">
                                                    <span class="bigger-110">Or Login Using</span>
                                                </div>

                                                <div class="social-login center">
                                                    <a class="btn btn-primary">
                                                        <i class="icon-facebook"></i>
                                                    </a>

                                                    <a class="btn btn-info">
                                                        <i class="icon-twitter"></i>
                                                    </a>

                                                    <a class="btn btn-danger">
                                                        <i class="icon-google-plus"></i>
                                                    </a>
                                                </div>
                                            </div>

                                            <div class="toolbar clearfix">
                                                <div>
                                                    <a href="#" class="forgot-password-link">
                                                        <i class="icon-arrow-left"></i>
                                                        Quên mật khẩu
                                                    </a>
                                                </div>

                                                <div>
                                                    <a href="/User/Register" class="user-signup-link">
                                                        <i class="icon-arrow-right"></i>
                                                        Đăng ký mới
                                                    </a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--/Login Form-->
                                </form>
                            </div>
                        </div>
                        <!--/widget-body-->
                    </div>
                    <!--/signup-box-->
                </div>
            </div>
        </div>
    </div>
</body>

</html>

<script type="text/javascript">
    $(document).ready(function () {
        $("#loginForm").validate({
            errorElement: 'div',
            errorClass: 'help-block',
            focusInvalid: false,
            rules: {
                username: {
                    required: true
                },
                password: {
                    required: true,
                    minlength: 6
                }
            },
            messages: {
                username: {
                    required: "Xin hãy tên tài khoản đăng nhập!",
                },
                password: {
                    required: "Xin hãy nhập mật khẩu đăng nhập!",
                    minlength: "Xin hãy nhập ít nhất 6 ký tự!"
                }
            },
            highlight: function (e) {
                $(e).closest('.control-group').removeClass('info').addClass('error');
            },
            success: function (e) {
                $(e).closest('.control-group').removeClass('error').addClass('info');
                $(e).remove();
            },
        });
    });
</script>

